package com.winit.page.repository;

import com.winit.page.model.Page;
import org.springframework.data.cassandra.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface PageRepository extends CrudRepository<Page, String> {
    @Query(value = "select * from matrix_page where ref_menu_id = ?0 allow filtering")
    List<Page> findByRefMenuId(String menuId);


    @Query(value = "select * from matrix_page where file_name = ?0 allow filtering")
    Page findByFileName(String fileName);

    @Query(value = "select * from matrix_page where id = ?0 allow filtering")
    Page findById(String id);

    @Query(value = "select * from matrix_page allow filtering")
    List<Page> findAllPage();
}
